import threading
from time import sleep, ctime


def dance():
    for i in range(3):
        print("正在跳舞...%d" % i)
        sleep(1)


def sing():
    for i in range(3):
        print("正在唱歌...%d" % i)
        sleep(1)


if __name__ == '__main__':
    print('---开始---:%s' % ctime())
    dance = threading.Thread(target=dance)
    sing = threading.Thread(target=sing)
    dance.start()
    sing.start()
    while True:
        length = len(threading.enumerate())
        print('当前运行的线程数为：%d' % length)
        if length <= 1:
            break

        sleep(0.5)
